import { eventTracking } from "@/utils/eventTracking";

export default {
  methods: {
    //数据埋点
    handleEventTrack(track) {
      if (track?.sign === "wifi") {
        const systemInfo = uni.getSystemInfoSync();
        const detail = {
          pubDomainBusinessId: track.pubDomainBusinessId || "",
          maOpenId: "", //用户个人的
          phone: "", //用户个人的
          phoneTypeName: `${systemInfo?.brand} ${systemInfo?.model}` || "",
          phoneSystemVersion: systemInfo?.system || "",
          wxVersion:
            `微信版本：${systemInfo.version}，基础库：${systemInfo.SDKVersion}` ||
            "",
          opType: track.opType || "",
          deviceNo: track.deviceNo || track.wifiCode || "",
          pubDomainShopId: track.pubDomainShopId || "",
          pubDomainShopName: track.pubDomainShopName || "",
          storeNo: track.storeNo || "",
          wifiName: track.wifiName || "",
          wifiPassword: track.password || track.wifiPassword || "",
          status: track.status || "",
          failReason: track.failReason || "",
        };
        console.log("数据埋点====", detail);
        console.log("手机信息", systemInfo);
        eventTracking("wifi", detail);
      }
    },
  },
};
